package mailtest;

import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.util.UUID;

/**
 * @Description:
 * @Author: yangzhiwei
 * @Date: 2021/6/23 15:27
 */
public class HttpTest {
    public static void main(String[] args) throws IOException {
        URL url = new URL("http://www.baidu.com");
        URLConnection connection = url.openConnection();
        InputStream stream = connection.getInputStream();
        //System.out.println(connection.getContent());
        InputStreamReader reader = new InputStreamReader(stream);
        BufferedReader br = new BufferedReader(reader);
        String data;
        while ( (data = br.readLine()) != null ) {
            System.out.println(new String(data));
        }

        File file = new File("https://bkimg.cdn.bcebos.com/pic/faf2b2119313b07e6a5add8902d7912396dd8c48");

        FileInputStream fis = new FileInputStream(file);
        System.out.println(file.getName());
        System.out.println(UUID.randomUUID());

    }
}
